// pages/set/make/make.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
	pg:1,
	data:[],
			pd:false,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
	  wx.getStorage({
		  key:'uid',
		  success: (e) => {
		  	this.setData({
				uid:e.data.uid
			})
			this.push()
		  }
	  })
  },
  none(e){
	  wx.request({
		  url:getApp().globalData.http+'action=canelServerOrder&id='+e.currentTarget.dataset.id,
		  success:(e)=>{
			  console.log(e)
			  this.push()
		  }
	  })
  },
  ovo() {
  	if (this.data.pd == 'false') {
  		let a = this.data.pg + 1
  		this.setData({
  			pg: a
  		})
  		this.push()
  	}
  },
  push(){
	  wx.request({
	  	url:getApp().globalData.http+'action=serverOrderList&uid='+this.data.uid+'&pg='+this.data.pg,
		success: (e) => {
			console.log(e)
			let a=this.data.data
			let x=e.data.data
			let c=[]
			if(e.data.data.length<15){
				this.setData({
					pd:true
				})
			}
			x.forEach(function(item,index){
				c=[]
				a.push(item)
				// console.log(item.ServerType.Tname)
				item.ServerType.forEach(function(item1,index1){
					c.push(item1.Tname)
				})
				let b=c.join()
				console.log(b)
				item.Server=b
			})
			this.setData({
				data:a
			})
		}
	  })
  }
})